<?php
namespace App\Listener;

use App\Event\OrderCreated;
use Hyperf\DbConnection\Db;
class SendOrderNotification
{
    public function __invoke(OrderCreated $event)
    {
        // 处理事件逻辑
        echo 'Order created: ';//.$event->order;
        $ids = Db::select(' SELECT max(id) as id FROM testtab_2020  ')[0];
        Db::table('testtab_2020')->insert([
            ['id' => $ids->id++, 'des' => 'des', 'des1' => 'des1', 'des3' => 'des3', 'created_at' => date('Y-m-d H:i:s')]
        ]);
    }
}